import QtQuick 2.12
import QtQuick.Controls 2.5

Page {
    id: page
    width: 600
    height: 400
    property alias buttonSet: buttonSet
    property alias textField: textField
    property alias label: label
    property alias buttonGet: buttonGet

    header: Label {
        text: qsTr("QML and C++ Exchange. Method 1")
        font.pixelSize: Qt.application.font.pixelSize * 2
        padding: 10
    }

    Label {
        id: label
        text: qsTr("You are on Page 1.")
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter
    }

    Button {
        id: buttonGet
        x: 255
        y: 207
        text: qsTr("Get")
        anchors.horizontalCenterOffset: 0
        anchors.horizontalCenter: parent.horizontalCenter
    }

    Button {
        id: buttonSet
        x: 86
        y: 207
        text: qsTr("Set")
    }

    TextField {
        id: textField
        x: 86
        y: 151
        width: 100
        height: 36
        text: "1001"
        font.pixelSize: 12
    }

    TextArea {
        id: textArea
        width: parent.width
        height: 134
        text: "// Method 1: Register class object to QML\n// decalare\nPage1Class myPage1Class;\n\n//register myPage1Class to qml\nengine.rootContext()->setContextProperty(\"myPage1Class\", &myPage1Class);"
        placeholderText: qsTr("Text Area")
    }
}
